#include "MainSvr.h"
#include "SvrMemBlock.h"

CMainSvr::CMainSvr()
{
}

CMainSvr::~CMainSvr()
{
    Destroy();
}

void *CMainSvr::operator new(size_t sz)
{
    void *ptr = nullptr;
    CSvrMemBlock *smb = CSvrMemBlock::GetInstance();

    if (nullptr != smb)
        ptr = smb->Alloc(sz);

    return ptr;
}

void CMainSvr::operator delete(void *ptr)
{
    CSvrMemBlock *smb = CSvrMemBlock::GetInstance();

    if (nullptr != smb)
        smb->Free(ptr);
}

bool CMainSvr::Init(int *fds)
{
    CServer::Init(fds);

    return true;
}

// bool CMainSvr::Start()
// {
//     return true;
// }

// bool CMainSvr::Stop()
// {
//     // 执行CMainSvr的Stop
//     CServer::Stop();

//     return true;
// }

bool CMainSvr::Destroy()
{
    return CServer::Destroy();
}

bool CMainSvr::ErrorEvent(epoll_event &ee)
{
    return true;
}

bool CMainSvr::InputEvent(epoll_event &ee)
{
    return true;
}

bool CMainSvr::OutputEvent(epoll_event &ee)
{
    return true;
}

bool CMainSvr::IpcCmdEvent(IpcPkgBuf &pbRecv)
{
    return true;
}